#pragma once

#include "resource.h"
#include "atldlgs.h"

#include <atlframe.h>
#include <string>

class GeneralPropPage : public CPropertyPageImpl< GeneralPropPage >
                      , public CDialogResize< GeneralPropPage >
{
public:
    GeneralPropPage(void) {}

    enum { IDD = IDD_GENERAL_PAGE };

    BEGIN_DLGRESIZE_MAP(GeneralPropPage)
        BEGIN_DLGRESIZE_GROUP()
        DLGRESIZE_CONTROL(IDC_BROWSE_EDT, DLSZ_SIZE_X )
        DLGRESIZE_CONTROL(IDC_BROWSE_BTN, DLSZ_MOVE_X | DLSZ_MOVE_Y)
        END_DLGRESIZE_GROUP()
    END_DLGRESIZE_MAP()

    BEGIN_MSG_MAP(GeneralPropPage)
        COMMAND_ID_HANDLER(IDC_BROWSE_BTN, OnBrowseBtn)
        MESSAGE_HANDLER(WM_INITDIALOG, OnInitDialog)
        CHAIN_MSG_MAP(CPropertyPageImpl<GeneralPropPage>)
        CHAIN_MSG_MAP(CDialogResize<GeneralPropPage>)
    END_MSG_MAP()

    LRESULT OnInitDialog(UINT /*uMsg*/, WPARAM /*wParam*/, LPARAM /*lParam*/, BOOL& /*bHandled*/)
    {
        DlgResize_Init(FALSE);
        return TRUE;
    }

    LRESULT OnBrowseBtn(WORD /*wNotifyCode*/, WORD /*wID*/, HWND /*hWndCtl*/, BOOL& /*bHandled*/);

    std::wstring WorkingDir;
};
